﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace AutoPartsSearch.Web.ViewModels.SearchQuery
{
    public class SearchQueryAdd
    {

        public List<Part> Parts { get; set; }

        #region Car

        [UIHint("EmptyDropDown")]
        [Required]
        public int? CarType { get; set; }

        [UIHint("EmptyDropDown")]
        [Required]
        public int? CarYear { get; set; }

        [UIHint("EmptyDropDown")]
        [Required]
        public int? CarBrand { get; set; }

        [Required]
        public string CarModel { get; set; }

        public string CarModelAnother { get; set; }

        public string CarModification { get; set; }

        [Required]
        public string CarVin { get; set; }

        [Required]
        public string CarEngine { get; set; }

        [UIHint("EmptyDropDown")]
        public int? CarCase { get; set; }

        [UIHint("EmptyDropDown")]
        public int? CarTransmission { get; set; }

        [UIHint("EmptyDropDown")]
        public int? CarDrive { get; set; }

        [UIHint("EmptyDropDown")]
        public int? CarFuelType { get; set; }

#endregion

        #region Person

        [UIHint("EmptyDropDown")]
        [Required]
        public int City { get; set; }

        [Required]
        public string Name { get; set; }
        [Required]
        public string Phone { get; set; }
        public string Phone2 { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")]
        public string Email { get; set; }
        [DataType(DataType.MultilineText)]
        public string Comment { get; set; }

        #endregion
    }


    public class Part
    {
        [Required]
        public string PartName { get; set; }

        [UIHint("EmptyDropDown")]
        [Required]
        public int? PartGroup { get; set; }

        public string PartCatalogNumber { get; set; }

        [UIHint("EmptyDropDown")]
        [Required]
        public int? PartType { get; set; }

        [UIHint("EmptyDropDown")]
        [Required]
        public int? PartState { get; set; }

        [DataType(DataType.MultilineText)]
        public string PartDescription { get; set; }
    }

}